package com.bytenerd.utils.common;

import com.bytenerd.common.base.BaseResponse;
import com.bytenerd.common.enums.ResponseCode;

/**
 * @auther bytenred
 * 返回结果工具类
 */
public class ResultUtils{
    
    public static <T> BaseResponse<T> success(T data){
        return new BaseResponse(200,data,"操作成功");
    }

    public static BaseResponse error(Integer code,String msg){
        return new BaseResponse(code,null,msg);
    }

    public static BaseResponse error(ResponseCode responseCode){
        return new BaseResponse(responseCode);
    }

    public static BaseResponse error(ResponseCode responseCode,String msg){
        return new BaseResponse(responseCode,msg);
    }

}
